package o;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.huawei.appgallery.packagemanager.api.bean.ManagerTask;
import com.huawei.appgallery.packagemanager.api.callback.IDeleteApkPolicy;
import com.huawei.hmf.annotation.ApiDefine;
import com.huawei.hmf.annotation.Singleton;
import java.util.Comparator;

@ApiDefine(uri = coa.class)
@Singleton
public class cop implements coa {
    public static coh ˊ;
    private static Comparator<ManagerTask> ˋ;
    public static coj ˎ;
    private static IDeleteApkPolicy ˏ;
    public static cok ॱ;

    public void ˏ(coj o_coj) {
        ˎ = o_coj;
    }

    public void ˋ(coh o_coh) {
        ˊ = o_coh;
    }

    public void ˎ(cok o_cok) {
        ॱ = o_cok;
    }

    public long ˋ() {
        return cpk.ˏ().ॱ();
    }

    public cnz ˎ(String str) {
        ManagerTask ˏ = cpa.ˊ().ˏ(str, cod.UNINSTALL);
        if (ˏ == null || ˏ.mode != 1001) {
            return cnz.NOT_HANDLER;
        }
        return ˏ.status;
    }

    public cnz ˏ(String str) {
        ManagerTask ˏ = cpa.ˊ().ˏ(str);
        if (ˏ != null) {
            return ˏ.status;
        }
        return cnz.NOT_HANDLER;
    }

    public ManagerTask ˎ(String str, cod o_cod) {
        return cpa.ˊ().ˏ(str, o_cod);
    }

    @Nullable
    public ManagerTask ˋ(long j) {
        ManagerTask ˎ = cpa.ˊ().ˎ(j);
        if (ˎ != null) {
            return ˎ;
        }
        ˎ = cpa.ˊ().ॱ(j);
        return ˎ == null ? null : ˎ;
    }

    public void ˊ(IDeleteApkPolicy iDeleteApkPolicy) {
        ˏ = iDeleteApkPolicy;
    }

    public static Comparator<ManagerTask> ˎ() {
        if (ˋ == null) {
            return new cpi();
        }
        return ˋ;
    }

    @NonNull
    public static IDeleteApkPolicy ॱ() {
        if (ˏ == null) {
            return new cpg();
        }
        return ˏ;
    }
}
